#include<stdio.h>

int main()
{
	int yanghui[100][100] = {0};
	int size;
	printf("Plaese input the size of Yanghui triangle:>");
	scanf("%d", &size);
	
	int i, j;
	for(i = 0 ; i < size; i++)
	{
		for(j = 0; j < size; j++)
		{
			if(j == 0 || i == j)
			{
				yanghui[i][j] = 1;
			}
			else
			{
				yanghui[i][j] = yanghui[i - 1][j] + yanghui[i - 1][j - 1];
			}
		}
	}
	
	for(i = 0; i < size; i++)
	{
		for(j = 0; j <= i; j ++)
		{
			printf("%d ", yanghui[i][j]);
		}
		printf("\n");
	}
	
	return 0;
}
